// 调用 dispatch({
// type: 'contral/edit',
// })
function contralReducer(state = {count: 0,name: 'John'}, action) {
    switch (action.type) {
        case 'contral/edit':
            return {...state, name: action.name, count: action.count};
        default:
            return state;
    }
}

export function asnyncEdit() {
    return dispatch => {
        setTimeout(() => {
            dispatch({type: 'contral/edit', name: 'Mike', count: 1});
        }, 1000);
    };
}
export default contralReducer;